# _*_ coding:utf-8 _*_
__author__ = 'nico'
__date__ = '2019/8/12 5:34 PM'


import xadmin
from .models import EmailVertifyRecord, Banner
from xadmin import views

# 更换xamdin主题
class BaseSeting(object):
    enable_themes = True
    use_bootswatch = True


class GlobalSettings(object):
    site_title = '沐橙后台管理系统'
    site_footer = '沐橙在线网'
    menu_style = 'accordion'

class EmailVerityRecordAdmin(object):
    list_display = ['code', 'email', 'send_type', 'send_time']
    search_fields = ['code', 'email', 'send_type']
    list_filter = ['code', 'email', 'send_type', 'send_time']


class BannerAdmin(object):
    list_display = ['title', 'image', 'url', 'index', 'add_time']
    search_fields = ['title', 'image', 'url', 'index']
    list_filter = ['title', 'image', 'url', 'index', 'add_time']

xadmin.site.register(EmailVertifyRecord, EmailVerityRecordAdmin)
xadmin.site.register(Banner, BannerAdmin)
xadmin.site.register(views.BaseAdminView, BaseSeting)
xadmin.site.register(views.CommAdminView, GlobalSettings)
